package org.paradac;

import java.util.ArrayList;
import java.util.List;

public class Queue<T> {
	private List<T> items = new ArrayList<T>();
	
	public void add(T a) {
		synchronized (items) {
				items.add(a); 
    }
	}
	
	public int size() {
		synchronized (items) {
			return items.size();
    }
	}
	
	public T getNext() {
		synchronized (items) {
			if (items.size() > 0)
				return items.remove(0);
			else return null;
    }
	}
}
